﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="adminBorrowerDetail.aspx.cs" Inherits="LibrarySystem.WebForm11" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
    <div id="borrowerAdmin">
    <asp:Label ID="borrowerName" runat="server"></asp:Label><br />
    <asp:Label ID="borrowerID" runat="server"></asp:Label><br />
    <asp:Label ID="borrowerAddress" runat="server"></asp:Label><br />
    <asp:Label ID="borrowerTelNo" runat="server"></asp:Label><br />
    <asp:Label ID="borrowerCategory" runat="server"></asp:Label>
    <br /><br /></div>

    <div id="brwrActive">
    <asp:Label runat="server">Aktiva lån:</asp:Label>
    <asp:ListView ID="adminBorrowerActiveLoans" runat="server">
        <LayoutTemplate> 
             <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
        </LayoutTemplate>
        <ItemTemplate>    
                  
                <table id="actTable"> <tr><td id="brwrTitle"><%# Eval("Title") %> </td><td id="brwrBarcode">Barcode: <%# Eval("Barcode") %></td></tr>
                    <tr><td id="brwrSD">Lånad: <%# Eval("StartDate") %></td><td id="brwrED">Lämnas senast: <%# Eval("EndDate") %></td></tr>

                    <tr><td><asp:LinkButton ID="extendLoanBtn" CssClass="forlangBtn" runat="server" Text="Förläng" OnCommand="extendLoanBtn_Click" CommandName='<%#Eval("Barcode")%>'/></td></tr>
                        
                    
                </table>
                
        </ItemTemplate>        
    </asp:ListView>
        </div>


    <div id="brwrHistory">
    <br /><asp:Label runat="server">Historik:</asp:Label>
    <asp:ListView ID="adminBorrowerHistory" runat="server">
        <LayoutTemplate> 
             <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
        </LayoutTemplate>
        <ItemTemplate>                
                <table id="histTable"> <tr id="histRow1"><td id="brwrTitle"><%# Eval("Title") %> </td><td id="brwrBarcode">Barcode: <%# Eval("Barcode") %></td></tr>
                    <tr id="histRow2"><td id="brwrSD">Lånad: <%# Eval("StartDate") %></td><td id="brwrRD">Återlämnad: <%# Eval("ReturnDate") %></td><td id="brwrED">Lämnas senast: <%# Eval("EndDate") %></td></tr>
                </table>
        </ItemTemplate>        
    </asp:ListView>
        </div>


    <div id="adminControlDiv">
        <div id="adminControls">
            <asp:Button ID="adminCtrlModify" runat="server" CssClass="adminModify" Text="Modifiera" OnClick="adminCtrlModify_Click" />
            <asp:Button ID="adminCtrlRemove" runat="server" CssClass="adminDelete" Text="Ta bort" OnClick="adminCtrlRemove_Click" />
        </div>

        <asp:Panel id="adminModify" CssClass="adminPanel" runat="server" Visible="false">
            <asp:Label runat="server">Förnamn: 
            <asp:TextBox ID="modifyFirstName" runat="server"></asp:TextBox></asp:Label><br />
            <asp:Label  runat="server">Efternamn: 
            <asp:TextBox ID="modifyLastName" runat="server"></asp:TextBox></asp:Label><br />
            <asp:Label  runat="server" >Adress: 
            <asp:TextBox ID="modifyAddress" runat="server"></asp:TextBox></asp:Label><br />
            <asp:Label   runat="server" >Telefon: 
            <asp:TextBox ID="modifyTele" runat="server"></asp:TextBox></asp:Label><br />
            <asp:Label runat="server" >Kategori ID: 
            <asp:TextBox ID="modifyCategory" runat="server"></asp:TextBox></asp:Label><br />
            <asp:Button ID="adminCtrlSave" runat="server" CssClass="adminSave" Text="Spara" OnClick="adminCtrlSave_Click" />
        </asp:Panel>
    </div>
</asp:Content>
